package lab02.test32;

import java.util.HashMap;
import java.util.Map;

public class Test32 {

    public static void main(String[] args) {
        Map<String,String> map = new HashMap<>();
        map.put("id","10001");
        map.put("name","李四");
        map.put("gender","男");
        map.put("age","25");
        map.put("love","爱学 java");
        //遍历
        for(Map.Entry<String,String> entry : map.entrySet()){
            System.out.println( entry.getKey() + " : " + entry.getValue());

        }

        System.out.println("集合大小为：" + map.size());

        map.remove("age");
        System.out.println("删除后的遍历：");
        for(Map.Entry<String,String> entry : map.entrySet()){
            System.out.println( entry.getKey() + " : " + entry.getValue());

        }
    }
}
